package edu.ahut.corejava2;

public class TestQueue {
    //Queue is FIFO:(First In First Out
    public static void main(String[] args) {
        int[] data = new int[100];
        int head = 0, tail = -1;//[head:tail] 队列初始化

        for (int i = 0; i < 10; i++) {
            data[++tail] = i;//i入队
        }
        while (head <= tail) {//队列非空
            System.out.print(" "+data[head]);//查询队头元素
            ++head;//出队
        }
    }
}
